#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QObject>
#include <QMainWindow>
#include <QComboBox>
#include <QSpinBox>
#include <QResource>
#include <QWidget>
#include <QString>
#include <QColor>
#include <QCloseEvent>
#include <QMenuBar>
#include <QTabWidget>
#include <QMenu>
#include "ui_mainwindow.h"



namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(int logMaxLines = 10000,QWidget *parent = 0);
    ~MainWindow();

    /*
     *  Function to print an HTML text into the log input
     *  @param QString title : Title of the message
     *  @param QString content : content of the message
     *  @param QColor colorTitle : color of the title
     *  @param QColor colorText : color of the content
     */
    void log(QString title, QString content,  QColor colorTitle = QColor(), QColor colorText = QColor());


    /*
     *  Function to print an HTML text into the log input
     *  @param QString content : content of the message
     *  @param QColor colorText : color of the content
     */
    void log(QString content, QColor color = QColor());

    /*
     *  Function called when the user close the window
     *  @param QCloseEvent * event : Event
     */
    void closeEvent(QCloseEvent *event);


    /*
     *  Function to change the status bar message
     *  @param QString text : Text to set on the status bar
     *  @param int time : Milliseconds to display the message
     */
    void setStatusBar(QString text, int time = 100000);


    /*
     *  Function to get the UI
     *  @return Ui::MainWindow : UI
     */
    Ui::MainWindow * getUi();




    /*
     *  Function to set the revision number
     *  @param int: Revision
     */
    void setRevision(int i);


private:
    Ui::MainWindow * ui;                                //Pointer to the UI
    int logsLines;                                      //Nomber of line in the logs
    int logMaxLines;                                    //Maximum number of lines in the logs
public slots:
    void slotLog(QString title, QString content, QColor colorTitle = QColor(), QColor colorText = QColor());
    void slotLog(QString content, QColor color = QColor());
    void slotClearLogs();
    void slotSetStatusBar(QString text, int time = 100000);


signals:
    void signalSetStatusBar(QString text, int time = 100000);

};

#endif // MAINWINDOW_H
